Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add SyncSchema as alias for AutoMigrate() #7070

Closed

Conversation

ei-sugimoto
Copy link

@ei-sugimoto ei-sugimoto commented Jun 17, 2024

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

This PR is based on issue #7048.
GORM users will be able to perform automatic migration of database schemas using either AutoMigrate or SyncSchema.

User Case Description

gorm.AutoMigrate(&model.User{})
gorm.AutoMigrate(&model.Character{})
gorm.AutoMigrate(&model.UserCharacter{})

//or
gorm.SyncSchema(&model.User{})
gorm.SyncSchema(&model.Character{})
gorm.SyncSchema(&model.UserCharacter{})

@jinzhu
Copy link
Member

jinzhu commented Jun 17, 2024

Let's work together to improve the documentation. More APIs are not necessarily better for the project's development and can be ambiguous.

@jinzhu jinzhu closed this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants